<!DOCTYPE html>
<html lang="en">
<head>
<title>Checkout</title>
<base href="" />
<link href="images/cart.png" rel="icon" />
<meta name="HandheldFriendly" content="True" /><meta name="MobileOptimized" content="320" />	
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />    
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="css/facebook.css" />
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<!--<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>-->
<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.fancybox-1.3.4.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/flexslider.css" />
<script type="text/javascript" src="js/jquery.flexslider-min.js"></script> 
<script type="text/javascript" src="js/tabs.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script src="js/html5.js"></script>
<script type="text/javascript">
		$(window).load(function() {
			$('.flexslider').flexslider();
		});
</script>
<script>
$(document).ready(function(){
$('.ab').hover(function(){
	$(this).prev('a').toggleClass('active');
	});     
$('.menuarrow').click(function () {
  $('.menu-mobile').slideToggle('slow');
});
$('.mobile-fpart .column h3').click(function () {
  $(this).next('.mobile-fpart .column ul').slideToggle('slow');
});
});
</script>
</head>
<body>
<div class="main-wrapper">
<header class="header-top-main">
<section class="header-top">
<div id="welcome">
        You are logged in as <a href="#">s</a> <b>(</b> <a href="#">Logout</a> <b>)</b>      </div>  
    <form action="#" method="post" enctype="multipart/form-data">
    <div id="currency"><!--Currency-->
                        <a title="Euro" onClick="">€</a>
                                    <a title="Pound Sterling" onClick="">£</a>
                                    <a title="US Dollar"><b>$</b></a>
                        <input type="hidden" name="currency_code" value="" />
      <input type="hidden" name="redirect" value="#" />
    </div>
  </form>
    <section id="cart">
    <div class="heading">
      <!--<h4>Shopping Cart</h4>-->
      <a><span id="cart_total">1 item(s) - $85.00</span></a></div>
    <div class="content"></div>
  </section>
  <div class="clear"></div>
</section>
<section id="header-main">
<div id="header">
    <div id="logo"><a href="#"><img src="images/logo.png" title="uStore Theme" alt="uStore Theme" /></a></div>
    <div class="links">
  <a class="home" title="Home" href="#">Home</a>
  <a href="#" id="wishlist_total">Wish List (2)</a><a href="#">My Account</a><a href="#">Shopping Cart</a><a href="#">Checkout</a></div> 
  <div id="search">
    <div class="button-search"></div>
        <input type="text" name="filter_name" value="Search" onClick="this.value = '';" onKeyDown="this.style.color = '#444';" />
      </div></div>
  <div class="clear"></div>
</section>
<nav id="mobile-menu">
<h3 class="menuarrow"><span>Menu</span></h3>
  <ul class="menu-mobile">
        <li><a href="#">Desktops</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_26">PC (0)</a></li>
                                        <li><a href="#_27">Mac (1)</a></li>
                            </ul>
              </div>
          </li>
        <li><a href="#">Laptops</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_46">Macs (0)</a></li>
                                        <li><a href="#_45">Windows (0)</a></li>
                            </ul>
              </div>
          </li>
        <li><a href="#">Components</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_29">Mice and Trackballs (0)</a></li>
                                        <li><a href="#_28">Monitors (2)</a></li>
                                        <li><a href="#_30">Printers (0)</a></li>
                                        <li><a href="#_31">Scanners (0)</a></li>
                                        <li><a href="#_32">Web Cameras (0)</a></li>
                            </ul>
              </div>
          </li>
        <li><a href="#">Tablets</a>
          </li>
        <li><a href="#">Software</a>
          </li>
        <li><a href="#">Phones &amp; PDAs</a>
          </li>
        <li><a href="#">Cameras</a>
          </li>
        <li><a href="#">MP3 Players</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_43">test 11 (0)</a></li>
                                        <li><a href="#_44">test 12 (0)</a></li>
                                        <li><a href="#_47">test 15 (0)</a></li>
                                        <li><a href="#_48">test 16 (0)</a></li>
                                        <li><a href="#_49">test 17 (0)</a></li>
                            </ul>
                <ul >
                                        <li><a href="#_50">test 18 (0)</a></li>
                                        <li><a href="#_51">test 19 (0)</a></li>
                                        <li><a href="#_52">test 20 (0)</a></li>
                                        <li><a href="#_53">test 21 (0)</a></li>
                                        <li><a href="#_54">test 22 (0)</a></li>
                            </ul>
                <ul >
                                        <li><a href="#_55">test 23 (0)</a></li>
                                        <li><a href="#_56">test 24 (0)</a></li>
                                        <li><a href="#_38">test 4 (0)</a></li>
                                        <li><a href="#_37">test 5 (0)</a></li>
                                        <li><a href="#_39">test 6 (0)</a></li>
                            </ul>
                <ul >
                                        <li><a href="#_40">test 7 (0)</a></li>
                                        <li><a href="#_41">test 8 (0)</a></li>
                                        <li><a href="#_42">test 9 (0)</a></li>
                                                                    </ul>
              </div>
          </li>
      </ul>
</nav>
<nav class="menu-main">
<div id="menu">
  <ul>
        <li><a href="#">Desktops</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_26">PC (0)</a></li>
                                        <li><a href="#_27">Mac (1)</a></li>
                            </ul>
              </div>
          </li>
        <li><a href="#">Laptops</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_46">Macs (0)</a></li>
                                        <li><a href="#_45">Windows (0)</a></li>
                            </ul>
              </div>
          </li>
        <li><a href="#">Components</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_29">Mice and Trackballs (0)</a></li>
                                        <li><a href="#_28">Monitors (2)</a></li>
                                        <li><a href="#_30">Printers (0)</a></li>
                                        <li><a href="#_31">Scanners (0)</a></li>
                                        <li><a href="#_32">Web Cameras (0)</a></li>
                            </ul>
              </div>
          </li>
        <li><a href="#">Tablets</a>
          </li>
        <li><a href="#">Software</a>
          </li>
        <li><a href="#">Phones &amp; PDAs</a>
          </li>
        <li><a href="#">Cameras</a>
          </li>
        <li><a href="#">MP3 Players</a>
            <div class="ab">
                <ul >
                                        <li><a href="#_43">test 11 (0)</a></li>
                                        <li><a href="#_44">test 12 (0)</a></li>
                                        <li><a href="#_47">test 15 (0)</a></li>
                                        <li><a href="#_48">test 16 (0)</a></li>
                                        <li><a href="#_49">test 17 (0)</a></li>
                            </ul>
                <ul >
                                        <li><a href="#_50">test 18 (0)</a></li>
                                        <li><a href="#_51">test 19 (0)</a></li>
                                        <li><a href="#_52">test 20 (0)</a></li>
                                        <li><a href="#_53">test 21 (0)</a></li>
                                        <li><a href="#_54">test 22 (0)</a></li>
                            </ul>
                <ul >
                                        <li><a href="#_55">test 23 (0)</a></li>
                                        <li><a href="#_56">test 24 (0)</a></li>
                                        <li><a href="#_38">test 4 (0)</a></li>
                                        <li><a href="#_37">test 5 (0)</a></li>
                                        <li><a href="#_39">test 6 (0)</a></li>
                            </ul>
                <ul >
                                        <li><a href="#_40">test 7 (0)</a></li>
                                        <li><a href="#_41">test 8 (0)</a></li>
                                        <li><a href="#_42">test 9 (0)</a></li>
                                                                    </ul>
              </div>
          </li>
      </ul>
</div>
</nav>
</header>
<section class="wrapper">
<div id="notification"></div>
<div id="container"> 
<section id="content">  <div class="breadcrumb">
        <a href="#">Home</a>
         &raquo; <a href="#">Shopping Cart</a>
         &raquo; <a href="#">Checkout</a>
      </div>
  <h1><span>Checkout</span></h1>
  <div class="checkout">
    <div id="checkout">
      <div class="checkout-heading">Step 1: Checkout Options</div>
      <div class="checkout-content"></div>
    </div>
        <div id="payment-address">
      <div class="checkout-heading"><span>Step 2: Billing Details</span></div>
      <div class="checkout-content"></div>
    </div>
            <div id="shipping-address">
      <div class="checkout-heading">Step 3: Delivery Details</div>
      <div class="checkout-content"></div>
    </div>
    <div id="shipping-method">
      <div class="checkout-heading">Step 4: Delivery Method</div>
      <div class="checkout-content"></div>
    </div>
        <div id="payment-method">
      <div class="checkout-heading">Step 5: Payment Method</div>
      <div class="checkout-content"></div>
    </div>
    <div id="confirm">
      <div class="checkout-heading">Step 6: Confirm Order</div>
      <div class="checkout-content"></div>
    </div>
  </div>
  </section>
<script type="text/javascript"><!--
$('#checkout .checkout-content input[name=\'account\']').live('change', function() {
	if ($(this).attr('value') == 'register') {
		$('#payment-address .checkout-heading span').html('Step 2: Account &amp; Billing Details');
	} else {
		$('#payment-address .checkout-heading span').html('Step 2: Billing Details');
	}
});

$('.checkout-heading a').live('click', function() {
	$('.checkout-content').slideUp('slow');
	
	$(this).parent().parent().find('.checkout-content').slideDown('slow');
});
$(document).ready(function() {
	$.ajax({
		url: 'index.php?route=checkout/address/payment',
		dataType: 'json',
		success: function(json) {
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['output']) {
				$('#payment-address .checkout-content').html(json['output']);
				
				$('#payment-address .checkout-content').slideDown('slow');
			}
		}
	});	
});

// Checkout
$('#button-account').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/' + $('input[name=\'account\']:checked').attr('value'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-account').attr('disabled', true);
			$('#button-account').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},		
		complete: function() {
			$('#button-account').attr('disabled', false);
			$('.wait').remove();
		},			
		success: function(json) {
			$('.warning').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['output']) {			
				$('#payment-address .checkout-content').html(json['output']);
				
				$('#checkout .checkout-content').slideUp('slow');
				
				$('#payment-address .checkout-content').slideDown('slow');
				
				$('.checkout-heading a').remove();
				
				$('#checkout .checkout-heading').append('<a>Modify &raquo;</a>');
			}
		}
	});
});

// Login
$('#button-login').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/login',
		type: 'post',
		data: $('#checkout #login :input'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-login').attr('disabled', true);
			$('#button-login').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#button-login').attr('disabled', false);
			$('.wait').remove();
		},				
		success: function(json) {
			$('.warning').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['total']) {
				$('#cart_total').html(json['total']);
			}
			
			if (json['logged']) {
				$('#welcome').html(json['logged']);
			}
						
			if (json['error']) {
				$('#checkout .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');
				
				$('.warning').fadeIn('slow');
			} else {								
				$.ajax({
					url: 'index.php?route=checkout/address/payment',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}						
						
						if (json['output']) {
							$('#payment-address .checkout-content').html(json['output']);
							
							$('#checkout .checkout-content').slideUp('slow');
							
							$('#payment-address .checkout-content').slideDown('slow');
							
							$('#payment-address .checkout-heading span').html('Step 2: Billing Details');
							
							$('.checkout-heading a').remove();
						}
					}
				});	
			}
		}
	});	
});

// Register
$('#button-register').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/register',
		type: 'post',
		data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'password\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address select'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-register').attr('disabled', true);
			$('#button-register').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#button-register').attr('disabled', false); 
			$('.wait').remove();
		},			
		success: function(json) {
			$('.warning').remove();
			$('.error').remove();
						
			if (json['redirect']) {
				location = json['redirect'];
			}
						
			if (json['error']) {
				if (json['error']['warning']) {
					$('#payment-address .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');
					
					$('.warning').fadeIn('slow');
				}
				
				if (json['error']['firstname']) {
					$('#payment-address input[name=\'firstname\'] + br').after('<span class="error">' + json['error']['firstname'] + '</span>');
				}
				
				if (json['error']['lastname']) {
					$('#payment-address input[name=\'lastname\'] + br').after('<span class="error">' + json['error']['lastname'] + '</span>');
				}	
				
				if (json['error']['email']) {
					$('#payment-address input[name=\'email\'] + br').after('<span class="error">' + json['error']['email'] + '</span>');
				}
				
				if (json['error']['telephone']) {
					$('#payment-address input[name=\'telephone\'] + br').after('<span class="error">' + json['error']['telephone'] + '</span>');
				}		
										
				if (json['error']['address_1']) {
					$('#payment-address input[name=\'address_1\'] + br').after('<span class="error">' + json['error']['address_1'] + '</span>');
				}	
				
				if (json['error']['city']) {
					$('#payment-address input[name=\'city\'] + br').after('<span class="error">' + json['error']['city'] + '</span>');
				}	
				
				if (json['error']['postcode']) {
					$('#payment-address input[name=\'postcode\'] + br').after('<span class="error">' + json['error']['postcode'] + '</span>');
				}	
				
				if (json['error']['country']) {
					$('#payment-address select[name=\'country_id\'] + br').after('<span class="error">' + json['error']['country'] + '</span>');
				}	
				
				if (json['error']['zone']) {
					$('#payment-address select[name=\'zone_id\'] + br').after('<span class="error">' + json['error']['zone'] + '</span>');
				}
				
				if (json['error']['password']) {
					$('#payment-address input[name=\'password\'] + br').after('<span class="error">' + json['error']['password'] + '</span>');
				}	
				
				if (json['error']['confirm']) {
					$('#payment-address input[name=\'confirm\'] + br').after('<span class="error">' + json['error']['confirm'] + '</span>');
				}																																	
			} else {
								
				var shipping_address = $('#payment-address input[name=\'shipping_address\']:checked').attr('value');
				
				if (shipping_address) {
					$.ajax({
						url: 'index.php?route=checkout/shipping',
						dataType: 'json',
						success: function(json) {
							if (json['redirect']) {
								location = json['redirect'];
							}
														
							if (json['output']) {
								$('#shipping-method .checkout-content').html(json['output']);
								
								$('#payment-address .checkout-content').slideUp('slow');
								
								$('#shipping-method .checkout-content').slideDown('slow');
								
								$('#checkout .checkout-heading a').remove();
								$('#payment-address .checkout-heading a').remove();
								$('#shipping-address .checkout-heading a').remove();
								$('#shipping-method .checkout-heading a').remove();
								$('#payment-method .checkout-heading a').remove();											
								
								$('#shipping-address .checkout-heading').append('<a>Modify &raquo;</a>');									
								$('#payment-address .checkout-heading').append('<a>Modify &raquo;</a>');	
	
								$.ajax({
									url: 'index.php?route=checkout/address/shipping',
									dataType: 'json',
									success: function(json) {
										if (json['redirect']) {
											location = json['redirect'];
										}										
										
										if (json['output']) {
											$('#shipping-address .checkout-content').html(json['output']);
										}
									}
								});	
							}
						}
					});	
				} else {
					$.ajax({
						url: 'index.php?route=checkout/address/shipping',
						dataType: 'json',
						success: function(json) {
							if (json['redirect']) {
								location = json['redirect'];
							}
										
							if (json['output']) {
								$('#shipping-address .checkout-content').html(json['output']);
								
								$('#payment-address .checkout-content').slideUp('slow');
								
								$('#shipping-address .checkout-content').slideDown('slow');
								
								$('#checkout .checkout-heading a').remove();
								$('#payment-address .checkout-heading a').remove();
								$('#shipping-address .checkout-heading a').remove();
								$('#shipping-method .checkout-heading a').remove();
								$('#payment-method .checkout-heading a').remove();							

								$('#payment-address .checkout-heading').append('<a>Modify &raquo;</a>');	
							}
						}
					});			
				}
								
				$.ajax({
					url: 'index.php?route=checkout/address/payment',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}
									
						if (json['output']) {
							$('#payment-address .checkout-content').html(json['output']);
							
							$('#payment-address .checkout-heading span').html('Step 2: Billing Details');
						}
					}
				});
			}	 
		}
	});	
});

// Payment Address	
$('#payment-address #button-address').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/address/payment',
		type: 'post',
		data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'password\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address select'),
		dataType: 'json',
		beforeSend: function() {
			$('#payment-address #button-address').attr('disabled', true);
			$('#payment-address #button-address').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#payment-address #button-address').attr('disabled', false);
			$('.wait').remove();
		},			
		success: function(json) {
			$('.error').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['error']) {
				if (json['error']['firstname']) {
					$('#payment-address input[name=\'firstname\']').after('<span class="error">' + json['error']['firstname'] + '</span>');
				}
				
				if (json['error']['lastname']) {
					$('#payment-address input[name=\'lastname\']').after('<span class="error">' + json['error']['lastname'] + '</span>');
				}	
				
				if (json['error']['telephone']) {
					$('#payment-address input[name=\'telephone\']').after('<span class="error">' + json['error']['telephone'] + '</span>');
				}		
										
				if (json['error']['address_1']) {
					$('#payment-address input[name=\'address_1\']').after('<span class="error">' + json['error']['address_1'] + '</span>');
				}	
				
				if (json['error']['city']) {
					$('#payment-address input[name=\'city\']').after('<span class="error">' + json['error']['city'] + '</span>');
				}	
				
				if (json['error']['postcode']) {
					$('#payment-address input[name=\'postcode\']').after('<span class="error">' + json['error']['postcode'] + '</span>');
				}	
				
				if (json['error']['country']) {
					$('#payment-address select[name=\'country_id\']').after('<span class="error">' + json['error']['country'] + '</span>');
				}	
				
				if (json['error']['zone']) {
					$('#payment-address select[name=\'zone_id\']').after('<span class="error">' + json['error']['zone'] + '</span>');
				}
			} else {
								$.ajax({
					url: 'index.php?route=checkout/address/shipping',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}
									
						if (json['output']) {
							$('#shipping-address .checkout-content').html(json['output']);
						
							$('#payment-address .checkout-content').slideUp('slow');
							
							$('#shipping-address .checkout-content').slideDown('slow');
							
							$('#payment-address .checkout-heading a').remove();
							$('#shipping-address .checkout-heading a').remove();
							$('#shipping-method .checkout-heading a').remove();
							$('#payment-method .checkout-heading a').remove();
							
							$('#payment-address .checkout-heading').append('<a>Modify &raquo;</a>');	
						}
					}
				});
								
				$.ajax({
					url: 'index.php?route=checkout/address/payment',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}
									
						if (json['output']) {
							$('#payment-address .checkout-content').html(json['output']);
						}
					}
				});					
			}	  
		}
	});	
});

// Shipping Address			
$('#shipping-address #button-address').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/address/shipping',
		type: 'post',
		data: $('#shipping-address input[type=\'text\'], #shipping-address input[type=\'password\'], #shipping-address input[type=\'checkbox\']:checked, #shipping-address input[type=\'radio\']:checked, #shipping-address select'),
		dataType: 'json',
		beforeSend: function() {
			$('#shipping-address #button-address').attr('disabled', true);
			$('#shipping-address #button-address').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#shipping-address #button-address').attr('disabled', false);
			$('.wait').remove();
		},			
		success: function(json) {
			$('.error').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['error']) {
				if (json['error']['firstname']) {
					$('#shipping-address input[name=\'firstname\']').after('<span class="error">' + json['error']['firstname'] + '</span>');
				}
				
				if (json['error']['lastname']) {
					$('#shipping-address input[name=\'lastname\']').after('<span class="error">' + json['error']['lastname'] + '</span>');
				}	
				
				if (json['error']['email']) {
					$('#shipping-address input[name=\'email\']').after('<span class="error">' + json['error']['email'] + '</span>');
				}
				
				if (json['error']['telephone']) {
					$('#shipping-address input[name=\'telephone\']').after('<span class="error">' + json['error']['telephone'] + '</span>');
				}		
										
				if (json['error']['address_1']) {
					$('#shipping-address input[name=\'address_1\']').after('<span class="error">' + json['error']['address_1'] + '</span>');
				}	
				
				if (json['error']['city']) {
					$('#shipping-address input[name=\'city\']').after('<span class="error">' + json['error']['city'] + '</span>');
				}	
				
				if (json['error']['postcode']) {
					$('#shipping-address input[name=\'postcode\']').after('<span class="error">' + json['error']['postcode'] + '</span>');
				}	
				
				if (json['error']['country']) {
					$('#shipping-address select[name=\'country_id\']').after('<span class="error">' + json['error']['country'] + '</span>');
				}	
				
				if (json['error']['zone']) {
					$('#shipping-address select[name=\'zone_id\']').after('<span class="error">' + json['error']['zone'] + '</span>');
				}
			} else {
				$.ajax({
					url: 'index.php?route=checkout/shipping',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}
									
						if (json['output']) {
							$('#shipping-method .checkout-content').html(json['output']);
							
							$('#shipping-address .checkout-content').slideUp('slow');
							
							$('#shipping-method .checkout-content').slideDown('slow');
							
							$('#shipping-address .checkout-heading a').remove();
							$('#shipping-method .checkout-heading a').remove();
							$('#payment-method .checkout-heading a').remove();
							
							$('#shipping-address .checkout-heading').append('<a>Modify &raquo;</a>');							
						}
						
						$.ajax({
							url: 'index.php?route=checkout/address/shipping',
							dataType: 'json',
							success: function(json) {
								if (json['redirect']) {
									location = json['redirect'];
								}	
													
								if (json['output']) {
									$('#shipping-address .checkout-content').html(json['output']);
								}
							}
						});						
					}
				});	
			}  
		}
	});	
});

// Guest
$('#button-guest').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/guest',
		type: 'post',
		data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'checkbox\']:checked, #payment-address select'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-guest').attr('disabled', true);
			$('#button-guest').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#button-guest').attr('disabled', false); 
			$('.wait').remove();
		},			
		success: function(json) {
			$('.error').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['error']) {
				if (json['error']['firstname']) {
					$('#payment-address input[name=\'firstname\'] + br').after('<span class="error">' + json['error']['firstname'] + '</span>');
				}
				
				if (json['error']['lastname']) {
					$('#payment-address input[name=\'lastname\'] + br').after('<span class="error">' + json['error']['lastname'] + '</span>');
				}	
				
				if (json['error']['email']) {
					$('#payment-address input[name=\'email\'] + br').after('<span class="error">' + json['error']['email'] + '</span>');
				}
				
				if (json['error']['telephone']) {
					$('#payment-address input[name=\'telephone\'] + br').after('<span class="error">' + json['error']['telephone'] + '</span>');
				}		
										
				if (json['error']['address_1']) {
					$('#payment-address input[name=\'address_1\'] + br').after('<span class="error">' + json['error']['address_1'] + '</span>');
				}	
				
				if (json['error']['city']) {
					$('#payment-address input[name=\'city\'] + br').after('<span class="error">' + json['error']['city'] + '</span>');
				}	
				
				if (json['error']['postcode']) {
					$('#payment-address input[name=\'postcode\'] + br').after('<span class="error">' + json['error']['postcode'] + '</span>');
				}	
				
				if (json['error']['country']) {
					$('#payment-address select[name=\'country_id\'] + br').after('<span class="error">' + json['error']['country'] + '</span>');
				}	
				
				if (json['error']['zone']) {
					$('#payment-address select[name=\'zone_id\'] + br').after('<span class="error">' + json['error']['zone'] + '</span>');
				}
			} else {
					
				var shipping_address = $('#payment-address input[name=\'shipping_address\']:checked').attr('value');
				
				if (shipping_address) {
					$.ajax({
						url: 'index.php?route=checkout/shipping',
						dataType: 'json',
						success: function(json) {
							if (json['redirect']) {
								location = json['redirect'];
							}
										
							if (json['output']) {
								$('#shipping-method .checkout-content').html(json['output']);
								
								$('#payment-address .checkout-content').slideUp('slow');
								
								$('#shipping-method .checkout-content').slideDown('slow');
								
								$('#payment-address .checkout-heading a').remove();
								$('#shipping-address .checkout-heading a').remove();
								$('#shipping-method .checkout-heading a').remove();
								$('#payment-method .checkout-heading a').remove();		
																
								$('#payment-address .checkout-heading').append('<a>Modify &raquo;</a>');	
								$('#shipping-address .checkout-heading').append('<a>Modify &raquo;</a>');									
							}
							
							$.ajax({
								url: 'index.php?route=checkout/guest/shipping',
								dataType: 'json',
								success: function(json) {
									if (json['redirect']) {
										location = json['redirect'];
									}
												
									if (json['output']) {
										$('#shipping-address .checkout-content').html(json['output']);
									}
								}
							});
						}
					});					
				} else {
					$.ajax({
						url: 'index.php?route=checkout/guest/shipping',
						dataType: 'json',
						success: function(json) {
							if (json['redirect']) {
								location = json['redirect'];
							}	
													
							if (json['output']) {
								$('#shipping-address .checkout-content').html(json['output']);
								
								$('#payment-address .checkout-content').slideUp('slow');
								
								$('#shipping-address .checkout-content').slideDown('slow');
								
								$('#payment-address .checkout-heading a').remove();
								$('#shipping-address .checkout-heading a').remove();
								$('#shipping-method .checkout-heading a').remove();
								$('#payment-method .checkout-heading a').remove();
								
								$('#payment-address .checkout-heading').append('<a>Modify &raquo;</a>');	
							}
						}
					});
				}
							}	 
		}
	});	
});

// Guest Shipping
$('#button-guest-shipping').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/guest/shipping',
		type: 'post',
		data: $('#shipping-address input[type=\'text\'], #shipping-address select'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-guest-shipping').attr('disabled', true);
			$('#button-guest-shipping').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#button-guest-shipping').attr('disabled', false); 
			$('.wait').remove();
		},			
		success: function(json) {
			$('.error').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['error']) {
				if (json['error']['firstname']) {
					$('#shipping-address input[name=\'firstname\']').after('<span class="error">' + json['error']['firstname'] + '</span>');
				}
				
				if (json['error']['lastname']) {
					$('#shipping-address input[name=\'lastname\']').after('<span class="error">' + json['error']['lastname'] + '</span>');
				}	
										
				if (json['error']['address_1']) {
					$('#shipping-address input[name=\'address_1\']').after('<span class="error">' + json['error']['address_1'] + '</span>');
				}	
				
				if (json['error']['city']) {
					$('#shipping-address input[name=\'city\']').after('<span class="error">' + json['error']['city'] + '</span>');
				}	
				
				if (json['error']['postcode']) {
					$('#shipping-address input[name=\'postcode\']').after('<span class="error">' + json['error']['postcode'] + '</span>');
				}	
				
				if (json['error']['country']) {
					$('#shipping-address select[name=\'country_id\']').after('<span class="error">' + json['error']['country'] + '</span>');
				}	
				
				if (json['error']['zone']) {
					$('#shipping-address select[name=\'zone_id\']').after('<span class="error">' + json['error']['zone'] + '</span>');
				}
			} else {
				$.ajax({
					url: 'index.php?route=checkout/shipping',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}
									
						if (json['output']) {
							$('#shipping-method .checkout-content').html(json['output']);
							
							$('#shipping-address .checkout-content').slideUp('slow');
							
							$('#shipping-method .checkout-content').slideDown('slow');
							
							$('#shipping-address .checkout-heading a').remove();
							$('#shipping-method .checkout-heading a').remove();
							$('#payment-method .checkout-heading a').remove();
								
							$('#shipping-address .checkout-heading').append('<a>Modify &raquo;</a>');
						}
					}
				});				
			}	 
		}
	});	
});

$('#button-shipping').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/shipping',
		type: 'post',
		data: $('#'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-shipping').attr('disabled', true);
			$('#button-shipping').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#button-shipping').attr('disabled', false);
			$('.wait').remove();
		},			
		success: function(json) {
			$('.warning').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['error']) {
				if (json['error']['warning']) {
					$('#').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');
					
					$('.warning').fadeIn('slow');
				}			
			} else {
				$.ajax({
					url: 'index.php?route=checkout/payment',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}
												
						if (json['output']) {
							$('#payment-method .checkout-content').html(json['output']);
							
							$('#shipping-method .checkout-content').slideUp('slow');
							
							$('#payment-method .checkout-content').slideDown('slow');

							$('#shipping-method .checkout-heading a').remove();
							$('#payment-method .checkout-heading a').remove();
							
							$('#shipping-method .checkout-heading').append('<a>Modify &raquo;</a>');	
						}
					},
					error: function(xhr, ajaxOptions, thrownError) {
						alert(thrownError);
					}
				});					
			}
		}
	});	
});

$('#button-payment').live('click', function() {
	$.ajax({
		url: 'index.php?route=checkout/payment', 
		type: 'post',
		data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-payment').attr('disabled', true);
			$('#button-payment').after('<span class="wait">&nbsp;<img src="images/loading.gif" alt="" /></span>');
		},	
		complete: function() {
			$('#button-payment').attr('disabled', false);
			$('.wait').remove();
		},			
		success: function(json) {
			$('.warning').remove();
			
			if (json['redirect']) {
				location = json['redirect'];
			}
			
			if (json['error']) {
				if (json['error']['warning']) {
					$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');
					
					$('.warning').fadeIn('slow');
				}			
			} else {
				$.ajax({
					url: 'index.php?route=checkout/confirm',
					dataType: 'json',
					success: function(json) {
						if (json['redirect']) {
							location = json['redirect'];
						}	
					
						if (json['output']) {
							$('#confirm .checkout-content').html(json['output']);
							
							$('#payment-method .checkout-content').slideUp('slow');
							
							$('#confirm .checkout-content').slideDown('slow');
							
							$('#payment-method .checkout-heading a').remove();
							
							$('#payment-method .checkout-heading').append('<a>Modify &raquo;</a>');	
						}
					},
					error: function(xhr, ajaxOptions, thrownError) {
						alert(thrownError);
					}
				});					
			}
		}
	});	
});
//--></script> 
<div class="clear"></div>
</div> 
</section>

<div class="clear"></div>
<section id="footer-top-outside">
<div class="line-bottom">
<div id="customHome" class="container_12"><div id="about_us_footer"
	class="grid_3">
<h2>About uStore</h2>
<img class="about_us_image" alt="small logo" src="images/logo-small.png"/><p>      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum porttitor, sem vel venenatis interdum, tortor dolor lobortis purus, sed adipiscing ante nisi fringilla nunc. Mauris id erat eget diam pulvinar fringilla. Vestibulum blandit aliquam velit, non viverra turpis vulputate ac.</p>
</div>
 <!--  TWITTER --> <div id="twitter_footer"
	class="grid_3">
<h2>Latest Tweets</h2>
<ul id="twitter_update_list">
<!--<script type="text/javascript"
	src="//twitter.com/javascripts/blogger.js"></script> <script
	type="text/javascript"
	src="//twitter.com/statuses/user_timeline/envato.json?callback=twitterCallback2&count=2"></script>-->
</ul>
</div>
 <div id="contact_footer"
	class="grid_3">
<h2>Contact Us</h2>
<ul>
<li>
	<!-- TELEPHONE 1 -->
	<ul id="tel" class="contact_column">
		<li id="footer_telephone">+11 8832 456 123</li>


		<!-- TELEPHONE 2 -->
				<li id="footer_telephone2">+11 8832 456 123</li>
			</ul>
	
	<!-- FAX  -->
		<ul id="fax" class="contact_column">
		<li id="footer_fax">+11 0832 456 321</li>
	</ul>
	
	<!-- EMAIL 1 -->
		<ul id="mail" class="contact_column">
		<li id="footer_email">test@test.com</li>



		<!-- EMAIL 2 -->
				<li id="footer_email2">info@test.com</li>
			</ul>
	
	<!-- SKYPE -->
		<ul id="skype" class="contact_column">
		<li id="footer_skype">harnishdesign</li>
	</ul>
	</li>
</ul>
</div>
	 <!--  FACEBOOK --> <div id="facebook_footer"
	class="grid_3">
<h2>Facebook</h2>
<!--<script type="text/javascript"
	src="//static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US"></script>
<script type="text/javascript">FB.init("1690883eb733618b294e98cb1dfba95a");</script>

<script language="javascript" type="text/javascript">
//<![CDATA[
document.write('<fb:fan profile_id="80655071208" stream="0"	connections="6"	logobar="0" height="190px"	width="220"css="css/facebook.css?20"></fb:fan> ');
//]]>
</script>-->

</div>
 <!--  CUSTOM COLUMN -->  <!-- Categories --> </div>
<div class="clear"></div>
</div>

<div class="line-bottom1"></div>

</section>
<footer id="footer-main">
<div id="footer" class="mobile-fpart">
  <div class="column">
    <h3>Information</h3>
    <ul>
            <li><a href="#">About Us</a></li>
            <li><a href="#">Delivery Information</a></li>
            <li><a href="#">Privacy Policy</a></li>
            <li><a href="#">Terms &amp; Conditions</a></li>
          </ul>
  </div>
  <div class="column">
    <h3>Customer Service</h3>
    <ul>
      <li><a href="#">Contact Us</a></li>
      <li><a href="#">Returns</a></li>
      <li><a href="#">Site Map</a></li>
    </ul>
  </div>
  <div class="column">
    <h3>Extras</h3>
    <ul>
      <li><a href="#">Brands</a></li>
      <li><a href="#">Gift Vouchers</a></li>
      <li><a href="#">Affiliates</a></li>
      <li><a href="#">Specials</a></li>
    </ul>
  </div>
  <div class="column">
    <h3>My Account</h3>
    <ul>
      <li><a href="#">My Account</a></li>
      <li><a href="#">Order History</a></li>
      <li><a href="#">Wish List</a></li>
      <li><a href="#">Newsletter</a></li>
    </ul>
  </div>
</div>
<div id="footer">
  <div class="column">
    <h3>Information</h3>
    <ul>
            <li><a href="#">About Us</a></li>
            <li><a href="#">Delivery Information</a></li>
            <li><a href="#">Privacy Policy</a></li>
            <li><a href="#">Terms &amp; Conditions</a></li>
          </ul>
  </div>
  <div class="column">
    <h3>Customer Service</h3>
    <ul>
      <li><a href="#">Contact Us</a></li>
      <li><a href="#">Returns</a></li>
      <li><a href="#">Site Map</a></li>
    </ul>
  </div>
  <div class="column">
    <h3>Extras</h3>
    <ul>
      <li><a href="#">Brands</a></li>
      <li><a href="#">Gift Vouchers</a></li>
      <li><a href="#">Affiliates</a></li>
      <li><a href="#">Specials</a></li>
    </ul>
  </div>
  <div class="column">
    <h3>My Account</h3>
    <ul>
      <li><a href="#">My Account</a></li>
      <li><a href="#">Order History</a></li>
      <li><a href="#">Wish List</a></li>
      <li><a href="#">Newsletter</a></li>
    </ul>
  </div>
</div>
<div class="powered-main">
<div id="powered">
Theme by <a href="#" target="_blank">Design</a>
<div class="fl">
Powered By <a href="#">ABC</a><br /> uStore Theme &copy; 2012</div>
<div class="back-to-top" id="back-top"><a title="Back to Top" href="javascript:void(0)" class="backtotop">Top</a></div>
</div>
</div>
</footer>
</div>
<!--Scroll back to top-->
<script type='text/javascript'>
$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});
		});
jQuery('.backtotop').click(function(){
	jQuery('html, body').animate({scrollTop:0}, 'slow');
});
</script>
<!--end of Scroll back to top-->
</body>
</html>